<?php

class Application_Form_Transaction extends Zend_Form
{

    public function init()
    {     $transaction_id=new Zend_Form_Element_Hidden('transaction_id');
          $transaction_id->addFilter('Int');
          $bank = new Zend_Form_Element_Text('bank');
          $bank->setRequired(true)
                  ->setLabel('Bank Pembayar')
                   ->addFilter('stripTags')
                   ->addFilter('stringTrim')
                   ->addValidator('NotEmpty')
                   ->addErrorMessages(array('notEmpty'=>'Mohon isi kolom Bank'))
                   ->setAttrib('maxlength', '50');
          $akun = new Zend_Form_Element_Text('akun');
          $akun->setRequired(true)
                  ->setLabel('Akun Pembayar')
                   ->addFilter('stripTags')
                   ->addFilter('stringTrim')
                   ->addValidator('NotEmpty')
                   ->addErrorMessages(array('notEmpty'=>'Mohon isi kolom Akun'))
                   ->setAttrib('maxlength', '100');
          $bukti = new Zend_Form_Element_File('bukti');
          $bukti ->addValidator('Count', false, 1)
                  ->addValidator('Size', false, 102400)
                  ->setDestination(realpath('.').'\\images\\transactions\\')
                  ->addValidator('Extension', false, 'jpg,png')
                  ->addErrorMessage(array("error"
                                         =>"Mohon upload bukti pembayaran dengan extension
                                            .jpg atau .png"));
          $submit = new Zend_Form_Element_Submit('submit');
           $submit->setAttrib('id', 'submitBuyer')
                   ->setLabel('Submit');
           /*
            * Create Object Form Reset Button
            */
           $reset = new Zend_Form_Element_Reset('reset');
           $reset->setAttrib('id','resetBuyer')
                 ->setLabel('Reset');
           $this->addElements(array($transaction_id,$bank,$akun,$bukti,$submit,$reset));
    }


}

